﻿using System;
using ApplicationLibrary.SqlConnector;

namespace ProjectManager.Masters.ModuleData
{
    #region PM_Descriptions

    public class PM_Descriptions : Table
    {
        public static string Name = "PM_Descriptions";

        public static Column<DescriptionType> Type = new Column<DescriptionType>(Name, "", "Type", false);
        public static Column<string> Code = new Column<string>(Name, Properties.Resources.T_Code, "Code", LEN.CODE, false);
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Description", LEN.BIG_DESCRIPTION);

        public override iColumn ForeignKey
        {
            get { return Code; }
        }

        public PM_Descriptions()
        {
            VisibleInRadar(new iColumn[] { Code, Description });
            Tablename = Name;
            DefineKey(new iColumn[] { Type, Code });
        }
    }

    #endregion PM_Descriptions

    #region PM_Project

    public class PM_Project : Table
    {
        public static string Name = "PM_Project";

        public static Column<Counters> Type = new Column<Counters>(Name, Properties.Resources.T_Type, "Type", false);
        public static Column<int> Code = new Column<int>(Name, Properties.Resources.T_Code, "Code", false);
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Description", LEN.BIG_DESCRIPTION);
        public static Column<DateTime> Date = new Column<DateTime>(Name, Properties.Resources.T_Date, "Date");
        public static Column<string> Product = new Column<string>(Name, Properties.Resources.T_Product, "Product", LEN.CODE);
        public static Column<string> Version = new Column<string>(Name, Properties.Resources.T_Version, "Version", LEN.CODE);
        public static Column<string> Note = new Column<string>(Name, "", "Note", 2048);
        public static Column<Status> Status = new Column<Status>(Name, Properties.Resources.T_Status, "Status");
        public static Column<DateTime> StartingDate = new Column<DateTime>(Name, "", "StartingDate");
        public static Column<DateTime> EndingDate = new Column<DateTime>(Name, "", "EndingDate");
        public static Column<Counters> FatherType = new Column<Counters>(Name, Properties.Resources.T_Type, "FatherType");
        public static Column<int> Father = new Column<int>(Name, "", "Father");

        public override iColumn ForeignKey
        {
            get { return Code; }
        }

        public PM_Project()
        {
            VisibleInRadar(new iColumn[] { Code, Description, Product, Version, Status });
            Tablename = Name;
            DefineKey(new iColumn[] { Type, Code });
        }
    }

    #endregion PM_Project

    #region PM_Session

    public class PM_Session : Table
    {
        public static string Name = "PM_Session";

        public static Column<int> ID = new Column<int>(Name, "ID", "ID", false);
        public static Column<Counters> Type = new Column<Counters>(Name, Properties.Resources.T_Type, "Type", false);
        public static Column<int> Code = new Column<int>(Name, Properties.Resources.T_Code, "Code", false);
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Description", LEN.BIG_DESCRIPTION);
        public static Column<DateTime> StartDate = new Column<DateTime>(Name, "", "StartDate");
        public static Column<DateTime> EndDate = new Column<DateTime>(Name, "", "EndDate");
        public static Column<DateTime> TotalTime = new Column<DateTime>(Name, "", "TotalTime");

        public override iColumn ForeignKey
        {
            get { return Code; }
        }

        public PM_Session()
        {
            VisibleInRadar(new iColumn[] { ID, Type, Code, Description });
            Tablename = Name;
            DefineKey(new iColumn[] { ID });
        }
    }

    #endregion PM_Session
}